package com.financing.platform.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFpProjectSeriesDao;
import com.financing.platform.dao.impl.BaseDaoImpl;
import com.financing.platform.dto.FpProjectSeriesDTO;
import com.financing.platform.service.IFpProjectSeriesService;
/**
 * fp_shop_information  
 *  业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpProjectSeriesService")
public class FpProjectSeriesServiceImpl extends BaseDaoImpl implements IFpProjectSeriesService{

	@Autowired
	private IFpProjectSeriesDao fpProjectSeriesDao;

	@Override
	public int insert(FpProjectSeriesDTO fpProjectSeries) throws SQLException {
		fpProjectSeries.setDeleteTag("1");
		return fpProjectSeriesDao.insert(fpProjectSeries);
	}

	@Override
	public void update(FpProjectSeriesDTO fpProjectSeries) throws SQLException {
		fpProjectSeriesDao.update(fpProjectSeries);
	}

	@Override
	public void updateForce(FpProjectSeriesDTO fpProjectSeries) throws SQLException {
		fpProjectSeriesDao.updateForce(fpProjectSeries);
	}

	@Override
	public void delete(int id) throws SQLException {
		fpProjectSeriesDao.delete(id);
	}
	
	@Override
	public List<FpProjectSeriesDTO> queryList(FpProjectSeriesDTO fpProjectSeries) throws SQLException {
		return fpProjectSeriesDao.queryList(fpProjectSeries);
	}

	@Override
	public int queryListCount(FpProjectSeriesDTO fpProjectSeries) throws SQLException {
		return fpProjectSeriesDao.queryListCount(fpProjectSeries);
	}

	@Override
	public FpProjectSeriesDTO loadById(int id) throws SQLException {
		return fpProjectSeriesDao.loadById(id);
	}
 	@Override
	public FpProjectSeriesDTO queryListGetFirst(FpProjectSeriesDTO fpProjectSeries)
			throws SQLException {
		 List<FpProjectSeriesDTO> queryList = queryList(fpProjectSeries);
		 if(queryList==null||queryList.size()==0){
			 return new FpProjectSeriesDTO();
		 }
		 return queryList.get(0);
	}

	@Override
	public void deleteByProSeriesName(FpProjectSeriesDTO fpProjectSeriesDTO)
			throws SQLException {
		fpProjectSeriesDao.deleteByProSeriesName(fpProjectSeriesDTO);
	}
}
